package longcaisuyun.longcai.com.net;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2016/4/6.
 */
@HttpInlet(Net.MONTH)
public class PostMonth extends WHAsyPost<PostMonth.Info> {
    public String driverid;
    public String code;
    public String page;

    public PostMonth(String driverid, String code, String page, AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
        this.driverid = driverid;
        this.code = code;
        this.page = page;
    }

    @Override
    protected Info parser(JSONObject object) {
        Info info = new Info();

        try {
            info.message = object.getString("message");
            if (object.getString("message").equals("1")) {
                info.nextpage = object.getString("nextpage");
                info.nextpage = object.getString("ispage");
                info.jsonArray = object.getJSONArray("list");
                info.account=object.getString("account");
            }
            return info;
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static class Info {
        public String message = "";
        public String nextpage = "";
        public String ispage = "";
        public JSONArray jsonArray;
        public String  account="";
    }
}
